package com.ferris.observice;

import android.content.Context;
import android.widget.Toast;

import java.util.Observable;
import java.util.Observer;

//观察者
public class Student implements Observer{
	private Teacher girl;
	private Context context;
	private Listeming listeming;
	public Listeming getListeming() {
		return listeming;
	}

	public void setListeming(Listeming listeming) {
		this.listeming = listeming;
	}

	public Context getContext() {
		return context;
	}

	@Override
	public String toString() {
		return "Student [girl=" + girl + ", context=" + context + "]";
	}

	public void setContext(Context context) {
		this.context = context;
	}

	public Teacher getGirl() {
		return girl;
	}

	public void setGirl(Teacher girl) {
		this.girl = girl;
	}

	public Student(){
		
	}
	
	@Override
	public void update(Observable observable, Object data) {
		// TODO Auto-generated method stub
		this.girl = (Teacher)observable;
		Toast.makeText(context, "老师好！", Toast.LENGTH_LONG).show();
	}
	
	public interface Listeming{
		public void lisetem(String sss);
	}

}
